﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Gallery.aspx.cs" Inherits="Admin_Gallery" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>گالری تصاویر </title>
    <link href="~/Styles/B_Yekan.css" rel="stylesheet" type="text/css" />
    <link href="../Styles/main.css" rel="stylesheet" type="text/css" />
    <link href="../Guest/Gallery/styles/visuallightbox.css" rel="stylesheet" type="text/css" />
    <link href="../Guest/Gallery/styles/vlightbox6.css" rel="stylesheet" type="text/css" />
    <script src="../Guest/Gallery/scripts/jquery.min.js" type="text/javascript"></script>
    <script src="../Guest/Gallery/scripts/visuallightbox.js" type="text/javascript"></script>
    <script src="../Guest/Gallery/scripts/vlbdata6.js" type="text/javascript"></script>
    <link href="../Styles/TableStyles.css" rel="stylesheet" type="text/css" />    
    <script language="javascript" type="text/javascript">
        function CheckName(sender, e) {
            var maxUplouder = document.getElementById("<%=MaxPicFileUpload.ClientID %>");
            var minUplouder = document.getElementById("<%=MinPicFileUpload.ClientID %>");
            if (maxUplouder != "") {
                var maxFilepath = maxUplouder.value;
                var maxFilename = maxFilepath.substring(maxFilepath.lastIndexOf('\\') + 1).toLowerCase();
                var minFilepath = minUplouder.value;
                var minFilename = minFilepath.substring(minFilepath.lastIndexOf('\\') + 1).toLowerCase();
                if (minFilename != maxFilename) {
                    alert("نام دو تصویر باید یکسان باشد");
                    e.IsValid = false;
                    return;
                }
            }
            e.IsValid = true;
        }        
    </script>
</head>
<body class="sun">
    <form id="form1" runat="server">   
    <div id="header">
        <a href="../Default.aspx" class="logo">
            <img src="../Styles/images/logo.png" alt="" /></a>
                <ul>
            <li><a id="A1" href="~/Admin/Confirm.aspx" runat="server">آزمایش های تایید شده</a></li>
            <li><a id="A2" href="~/Admin/Paper.aspx" runat="server">مقاله ها</a></li>
            <li><a id="A3" href="~/Admin/Help.aspx" runat="server">راهنمای پذیرش</a></li>
            <li class="selected" ><a id="A4" href="~/Admin/Gallery.aspx" runat="server">گالری</a></li>
            <li><a id="A5" href="~/Admin/Sentence.aspx" runat="server">جمله روز</a></li>
            <li><a id="A6" href="~/Admin/Category.aspx" runat="server">گروه آزمایش</a></li>
            <li><a id="A7" href="~/Admin/CategoryItem.aspx" runat="server">آزمایشات</a></li>
            <li><a id="A8" href="~/Admin/User.aspx" runat="server">کاربران</a></li>
            <li><a id="A9" href="~/Admin/ChangePassword.aspx" runat="server">تغییر رمز</a></li>
            <li><a id="logout_a" href="#" runat="server" onclick="if(!confirm('آیا قصد خروج از سیستم را دارید؟')) return false;"
                onserverclick="LogoutButton_Click">خروج از سیستم</a></li>
        </ul>   
    </div>
    <div id="body" dir="rtl">
        <h2>
           گالری</h2>
        <br />
        <div align="center">
           <table style="width: 100%" title="گالری">
                <tr>
                    <td>
                        <table>
                            <tr>
                                <td style="width: 300px;" valign="top" align="right">
                                    <asp:MultiView ID="ImageMultiView" runat="server">
                                        <asp:View ID="NoFileView" runat="server">
                                            <p style="color:#767676">
                                                تصویری در مسیر فایل های گالری وجود ندارد
                                            </p>
                                        </asp:View>
                                        <asp:View ID="FileView" runat="server">
                                            <div style="overflow: auto; height: 300px;padding: 0px; margin: 0px">                                              
                                                    <asp:Table ID="ImageTable" runat="server">
                                                    </asp:Table>
                                                </div>
                                        </asp:View>
                                    </asp:MultiView>
                                </td>
                                <td style="width: 20px">
                                </td>
                                <td valign="top" align="center">
                                    <table border="0" cellpadding="0" cellspacing="0" style="width: 500px">
                                        <tr valign="middle">
                                            <td style="width: 80px;color:#767676" align="right">
                                                تصویر کوچک:
                                            </td>
                                            <td style="width: 380px" align="right" dir="rtl">
                                                <asp:FileUpload ID="MinPicFileUpload" runat="server" Width="350px" />
                                                <asp:RequiredFieldValidator ID="MinRequiredFieldValidator" runat="server" ErrorMessage="*"
                                                    ControlToValidate="MinPicFileUpload" ValidationGroup="Insert"></asp:RequiredFieldValidator>
                                            </td>
                                        </tr>
                                        <tr valign="middle">
                                            <td style="width: 80px;color:#767676" align="right">
                                                تصویر بزرگ:
                                            </td>
                                            <td style="width: 380px" align="right" dir="rtl">
                                                <asp:FileUpload ID="MaxPicFileUpload" runat="server" Width="350px" />
                                                <asp:RequiredFieldValidator ID="MaxRequiredFieldValidator" runat="server" ErrorMessage="*"
                                                    ControlToValidate="MaxPicFileUpload" ValidationGroup="Insert"></asp:RequiredFieldValidator>
                                            </td>
                                        </tr>
                                        <tr valign="middle">
                                            <td style="width: 80px" align="right">
                                            </td>
                                            <td style="width: 380px" align="right" dir="rtl">
                                                <asp:CustomValidator ID="fileNameCustomValidator" ValidationGroup="Insert" ControlToValidate="MaxPicFileUpload"
                                                    runat="server" ClientValidationFunction="CheckName" ErrorMessage="نام دو تصویر باید یکسان باشد"></asp:CustomValidator>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td colspan="2" align="left">
                                                <table border="0" cellpadding="0" cellspacing="0" style="width: 100%">
                                                    <tr>
                                                        <td style="height: 15px">
                                                            &nbsp;
                                                        </td>
                                                        <td align="left" valign="top" style="width: 80px;">
                                                        </td>
                                                        <td align="left" valign="top" style="width: 80px;">
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td style="height: 15px">
                                                            &nbsp;
                                                        </td>
                                                        <td align="left" valign="top" style="width: 80px;">
                                                            <asp:ImageButton ID="InsertButton" runat="server" CommandName="Insert" SkinID="InsertButton"
                                                                ValidationGroup="Insert" OnClick="InsertButton_Click" />
                                                        </td>
                                                    </tr>
                                                </table>
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>
        </div>
    </div>
     <div id="footer">
        <div style="text-align: center">
            <p>
                <span>2023 &copy; Delta System Anahita</span>
            </p>
        </div>
    </div>
    </form>
</body>
</html>
